package com.pointmi.api.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseStatus;

import com.pointmi.transactiondao.Transaction;
import com.pointmi.transactionservice.TransactionService;

@Controller
@RequestMapping("/pointmi-api/transaction")
public class TransactionController {
	
	@Autowired
	@Qualifier("transactionService")
	private TransactionService transactionService;

	@RequestMapping(method = RequestMethod.POST)
	@ResponseStatus( HttpStatus.CREATED )
	public void save(@RequestBody Transaction newTransaction)
	{
	  transactionService.saveOrUpdate(newTransaction);
	}
}
